Well the thins is when I run the script I got follow error:
/*===========================================================================================
Variables
==========================================================================================*/
Module m
Item i
string moduleName
Project pSys = project "/EMB550_04_Systems"
/*===========================================================================================
Interface Items
==========================================================================================*/
DB GUI = create "Checklist Test"
DBE selectChoiceQCSYS, selectChoiceQCHF
DBE textMultiLine
/*===========================================================================================
Answer Types
==========================================================================================*/
string options[] = {"Not Evaluated", "YES", "NO"}
/*===========================================================================================
Questions
==========================================================================================*/
selectChoiceQCSYS = choice(GUI, "Faça uma pergunta aqui", options, 0)
selectChoiceQCHF = choice(GUI, "Faça outra pergunta aqui", options, 0)
textMultiLine = text(GUI, "Completeness Validation Comments", m."Completeness Validation Comments" "" ,30, 60, false )
/*========================================================================================
Main Program
==========================================================================================*/
void buttonOK (DB GUI){
string moduleName
string aux = ""
bool wasModified = false
for i in pSys do {
if (type(i) "" == "Formal") {
moduleName = name(i)
if(matches("-R$", moduleName)){
if(canModify(m)){
if (get(selectChoiceQCSYS) =="NO" || get(selectChoiceQCHF)=="NO" ) {
if (get(textMultiLine) == "") {
warningBox("Add comments that describe why the requirement is not valid or the data entered will not be saved.\nThis will help author to correct the requirement.")
return
}
}
aux = get(selectChoiceQCSYS)
if(m."Validation QCSYS" "" != aux) {
m."Validation QCSYS" = aux
wasModified = true
}
aux = get(selectChoiceQCHF)
if(m."Validation QCHF" "" != aux) {
m."Validation QCHF" = aux
wasModified = true
}
aux = get(textMultiLine)
if(m."Completeness Validation Comments" "" != aux) {
m."Completeness Validation Comments" = get(textMultiLine)
wasModified = true
}
}
else infoBox "Cannot modify current object."
save m
close m
}
}
}
}
ok (GUI,"Apply!", buttonOK)
show GUI
Bruwbruw - Wed Oct 17 10:03:27 EDT 2012 |
Re: Script error message
Don't know about "not designated", but variable "m" has no value and you would get "unassigned variable (m)" message (in English anyway). If you do this at line 4
I think you want this at line 4:
-Louie Further down, it seems wrong to me to "save" and "close" a module that you did not actually open; and in any case it seems you are closing the module inside a loop in which you presume it to be open. Seems to me you should check (canModify(m)) at the top and don't bother displaying the dialog at all. |
Re: Script error message Module m = current Martin |